function [] = haar_testing(pos_dir,neg_dir,haar)
pos_images = strcat(pos_dir,'/','*.pgm');
neg_images = strcat(neg_dir,'/','*.pgm');
pos_set = dir(pos_images);
neg_set = dir(neg_images);

num_pos = size(pos_set,1)
num_neg = size(neg_set,1)

correct = 0;
wrong = 0;
false_positive = 0;
false_negative = 0;
total_pos = 1;
total_neg = 1;


for dir_i = 1:num_pos
        dir_name = pos_set(dir_i).name;
        path_name = strcat(pos_dir,'/',dir_name);
        img = double(imread(path_name));
	result = haar_detection(img,haar);
	if size(result,2) == 1
		correct = correct + 1;
	else
		wrong  = wrong + 1;
		false_negative = false_negative + 1;
	end
	fprintf('correct:%d wrong:%d(fp:%f,fn:%f)\n',correct,wrong,false_positive/total_neg,false_negative/total_pos);
	total_pos = total_pos + 1;
end

for dir_i = 1:num_neg
	dir_name = neg_set(dir_i).name;
        path_name = strcat(neg_dir,'/',dir_name);
        img = double(imread(path_name));
	result = haar_detection(img,haar);
	if size(result,2) == 0
		correct = correct + 1;
	else
		wrong  = wrong +1;
		false_positive = false_positive + 1;
	end
	fprintf('correct:%d wrong:%d(fp:%f,fn:%f)\n',correct,wrong,false_positive/total_neg,false_negative/total_pos);
	total_neg = total_neg + 1;
end


